*********************************************************************************************************
*                                                                                                       *
* Peace Treaties' Environmental Provisions and Conflict Recurrence                                      * 
*                                                                                                       *
* Tobias Böhmelt and Zorzeta Bakaki                                                                     *
*                                                                                                       *
* Address Correspondance to: tbohmelt@essex.ac.uk                                                       *
*                                                                                                       *
* This Version: December 6, 2025                                                                        *
*                                                                                                       *
*********************************************************************************************************

********************
* Data Preparation *
********************

use "Final Data.dta", clear

iis ccode

tis year

**************************
* Descriptive Statistics *
**************************

sum recur environment_ref substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion if recur!=.

***********************************
* Fixed and Random Effects Models *
***********************************

eststo clear
eststo: xtreg recur environment_ref c.peaceyrs##c.peaceyrs##c.peaceyrs i.year, fe cluster (ccode)
estimates store reg1
eststo: xtreg recur environment_ref substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion c.peaceyrs##c.peaceyrs##c.peaceyrs i.year, fe cluster (ccode)
estimates store reg2
eststo: xtreg recur environment_ref c.peaceyrs##c.peaceyrs##c.peaceyrs i.year, re cluster (ccode)
estimates store reg3
eststo: xtreg recur environment_ref substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion c.peaceyrs##c.peaceyrs##c.peaceyrs i.year, re cluster (ccode)
estimates store reg4
esttab reg1 reg2 reg3 reg4, replace stats(N, fmt(%9.0fc) labels("Observations")) se star(* 0.10 ** 0.05 *** 0.01) b(%10.3f) label drop(*.year) nonumbers mtitles("Model 1" "Model 2" "Model 3" "Model 4") 

preserve
tab year, gen(year_fe)
tab ccode, gen(country_fe)
gen peaceyrs2=peaceyrs*peaceyrs
gen peaceyrs3=peaceyrs*peaceyrs2
estsimp reg recur environment_ref substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion peaceyrs peaceyrs2 peaceyrs3 year_fe* country_fe* 
sum b1, detail
local x1 `r(mean)'
kdensity b1, xli(`x1', lcolor(gs10) lpattern(dash)) legend(off) scheme(538w) aspectratio(1) title("") xtitle("Simulated Effect") legend(off) note("") name(graph1, replace)
restore

preserve
tab year, gen(year_fe)
tab ccode, gen(country_fe)
gen peaceyrs2=peaceyrs*peaceyrs
gen peaceyrs3=peaceyrs*peaceyrs2
rename dem_index Democracy
reg recur environment_ref substantive_agreement intra_agreement UN_involvement Democracy gdp_ln pop_ln pol_exclusion peaceyrs peaceyrs2 peaceyrs3 year_fe* country_fe* 
sensemakr recur environment_ref substantive_agreement intra_agreement UN_involvement Democracy gdp_ln pop_ln pol_exclusion peaceyrs peaceyrs2 peaceyrs3 year_fe* country_fe*, treat(environment_ref) benchmark(Democracy) contourplot
restore

xtreg recur environment_ref substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion c.peaceyrs##c.peaceyrs##c.peaceyrs i.year, fe cluster (ccode)
margins, at(environment_ref=(0 1))
marginsplot, scheme(538w) level(84) aspectratio(1) ytitle("Predicted Probability of Conflict Recurrence") name(graph2, replace)

*************************************
* Recursive Bivariate Probit Models *
*************************************

eststo clear
eststo: rbiprobit recur=c.peaceyrs##c.peaceyrs##c.peaceyrs, endog(environment_ref=severe_dis c.envyrs##c.envyrs##c.envyrs) vce(cluster ccode)
estimates store reg5
eststo: rbiprobit recur=substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion c.peaceyrs##c.peaceyrs##c.peaceyrs, endog(environment_ref=severe_dis agreement_length UN_involvement dem_index trade_openess c.envyrs##c.envyrs##c.envyrs) vce(cluster ccode)
estimates store reg6
esttab reg5 reg6, replace stats(N, fmt(%9.0fc) labels("Observations")) se star(* 0.10 ** 0.05 *** 0.01) b(%10.3f) label nonumbers mtitles("Model 5" "Model 6") 

qui rbiprobit recur=c.peaceyrs##c.peaceyrs##c.peaceyrs, endog(environment_ref=severe_dis c.envyrs##c.envyrs##c.envyrs) vce(cluster ccode)
rbiprobit tmeffects, tmeff(ate)
marginsplot, scheme(538w) aspectratio(1) ytitle("Average Treatment Effect on Conflict Recurrence") title("Environmental Provisions") name(graph3, replace)
qui  rbiprobit recur=substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion c.peaceyrs##c.peaceyrs##c.peaceyrs, endog(environment_ref=severe_dis agreement_length UN_involvement dem_index trade_openess c.envyrs##c.envyrs##c.envyrs) vce(cluster ccode)
rbiprobit tmeffects, tmeff(ate)
marginsplot, scheme(538w) aspectratio(1) ytitle("Average Treatment Effect on Conflict Recurrence") title("Environmental Provisions") name(graph4, replace)
preserve
generate var53 = 5 in 1
replace var53 = 6 in 2
generate var54 = -0.1273109 in 1
generate var55 = -0.1728692 in 1
generate var56 = -0.0817525 in 1
replace var54 = -0.1005283  in 2
replace var55 = -0.1415077  in 2
replace var56 = -0.059549 in 2
twoway (scatter var53 var54, msize(medium)) (rcap var55 var56 var53, lcolor(538b) lwidth(medthick) lpattern(dash) horizontal msize(zero)), ytitle("Models") ylabel(4(1)7) xtitle("Average Treatment Effect on Conflict Recurrence") xline(0, lpattern(vshortdash) lcolor(538r)) xlabel(-0.2(0.05)0, format(%3.2f)) legend(off) scheme(538w) name(graph5, replace) aspectratio(1)
restore

****************************
* Counterfactual Estimator *
****************************

preserve
by ccode: gen year_new=_n
xtset ccode year_new
gen peaceyrs2=peaceyrs*peaceyrs
gen peaceyrs3=peaceyrs*peaceyrs2
fect recur, treat(environment_ref) unit(ccode) time(year_new) cov(substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion peaceyrs peaceyrs2 peaceyrs3) method("fe") force("two-way") se  
mat list e(ATT)
mat list e(coefs)   
fect recur, treat(environment_ref) unit(ccode) time(year_new) cov(peaceyrs peaceyrs2 peaceyrs3) method("fe") force("two-way") se placeboTest 
fect recur, treat(environment_ref) unit(ccode) time(year_new) cov(peaceyrs peaceyrs2 peaceyrs3) method("fe") force("two-way") se equiTest 
fect recur, treat(environment_ref) unit(ccode) time(year_new) cov(peaceyrs peaceyrs2 peaceyrs3) method("fe") force("two-way") se carryoverTest 
restore

************
* Appendix *
************

eststo clear
eststo:rbiprobit recur=substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion power_participation c.peaceyrs##c.peaceyrs##c.peaceyrs, endog(environment_ref=severe_dis agreement_length UN_involvement dem_index trade_openess c.envyrs##c.envyrs##c.envyrs) vce(cluster ccode) 
estimates store regA1
eststo:rbiprobit recur=substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion left_ideology c.peaceyrs##c.peaceyrs##c.peaceyrs, endog(environment_ref=severe_dis agreement_length UN_involvement dem_index trade_openess c.envyrs##c.envyrs##c.envyrs) vce(cluster ccode) 
estimates store regA2
eststo:rbiprobit recur=substantive_agreement intra_agreement no_agreements UN_involvement dem_index gdp_ln pop_ln pol_exclusion c.peaceyrs##c.peaceyrs##c.peaceyrs, endog(environment_ref=severe_dis agreement_length UN_involvement dem_index trade_openess c.envyrs##c.envyrs##c.envyrs) vce(cluster ccode) 
estimates store regA3
eststo:rbiprobit recur=substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion c.peaceyrs##c.peaceyrs##c.peaceyrs, endog(environment_ref=severe_dis agreement_length UN_involvement dem_index political_glob c.envyrs##c.envyrs##c.envyrs) vce(cluster ccode) 
estimates store regA4
eststo:rbiprobit recur=substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion c.peaceyrs##c.peaceyrs##c.peaceyrs, endog(environment_ref=severe_dis agreement_length UN_involvement dem_index trade_openess wdi_gdpagr c.envyrs##c.envyrs##c.envyrs) vce(cluster ccode) 
estimates store regA5
eststo:rbiprobit recur=substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion c.peaceyrs##c.peaceyrs##c.peaceyrs, endog(environment_ref=severe_dis agreement_length UN_involvement dem_index trade_openess aid_log c.envyrs##c.envyrs##c.envyrs) vce(cluster ccode) 
estimates store regA6
esttab regA1 regA2 regA3 regA4 regA5 regA6, replace stats(N, fmt(%9.0fc) labels("Observations")) se star(* 0.10 ** 0.05 *** 0.01) b(%10.3f) label nonumbers mtitles("Model A1" "Model A2" "Model A3" "Model A1" "Model A5" "Model A6") 
esttab using "TableA1.tex",   /*
 */ se title(Additional Control Variables)  nonumbers /*
 */ mtitles("Model A1" "Model 2" "Model A3" "Model A4" "Model A5" "Model A6") label nodep nogaps star(* 0.10 ** 0.05 *** 0.01) b(%8.3f) /*
 */ nonotes addnotes("$* p < 0.10, ** p < 0.05, *** p < 0.01$" "Standard errors clustered on country in parentheses") replace   
 
eststo clear
eststo: rbiprobit recur=substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion c.peaceyrs##c.peaceyrs##c.peaceyrs, endog(environment_ref=dis agreement_length UN_involvement dem_index trade_openess c.envyrs##c.envyrs##c.envyrs) vce(cluster ccode)
estimates store regA7
eststo: rbiprobit recur=substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion c.peaceyrs##c.peaceyrs##c.peaceyrs, endog(environment_ref=disasters_cum_sum agreement_length UN_involvement dem_index trade_openess c.envyrs##c.envyrs##c.envyrs) vce(cluster ccode)
estimates store regA8
esttab regA7 regA8, replace stats(N, fmt(%9.0fc) labels("Observations")) se star(* 0.10 ** 0.05 *** 0.01) b(%10.3f) label nonumbers mtitles("Model A7" "Model A8")  
esttab using "TableA2.tex",   /*
*/ se title(Different Operationalization of Disaster)  nonumbers /*
*/ mtitles("Model A7" "Model A8") label nodep nogaps star(* 0.10 ** 0.05 *** 0.01) b(%8.3f) /*
*/ nonotes addnotes("$* p < 0.10, ** p < 0.05, *** p < 0.01$" "Standard errors clustered on country in parentheses") replace  

preserve
replace recur=0 if recur==. & environment_ref!=.
drop peaceyrs
btscs recur year ccode, g(peaceyrs)
eststo clear
eststo: rbiprobit recur=substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion c.peaceyrs##c.peaceyrs##c.peaceyrs, endog(environment_ref=severe_dis agreement_length UN_involvement dem_index trade_openess c.envyrs##c.envyrs##c.envyrs) vce(cluster ccode)
estimates store regA9
esttab regA9, replace stats(N, fmt(%9.0fc) labels("Observations")) se star(* 0.10 ** 0.05 *** 0.01) b(%10.3f) label nonumbers mtitles("Model A9")  
esttab using "TableA3.tex",   /*
*/ se title(Different Operationalization of Recurrence)  nonumbers /*
*/ mtitles("Model A9") label nodep nogaps star(* 0.10 ** 0.05 *** 0.01) b(%8.3f) /*
*/ nonotes addnotes("$* p < 0.10, ** p < 0.05, *** p < 0.01$" "Standard errors clustered on country in parentheses") replace  
restore

eststo clear
eststo: rbiprobit recur=policy_air_pollution substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion c.peaceyrs##c.peaceyrs##c.peaceyrs, endog(environment_ref=severe_dis agreement_length UN_involvement dem_index trade_openess c.envyrs##c.envyrs##c.envyrs) vce(cluster ccode)
estimates store regA10
esttab regA10, replace stats(N, fmt(%9.0fc) labels("Observations")) se star(* 0.10 ** 0.05 *** 0.01) b(%10.3f) label nonumbers mtitles("Model A10")  
esttab using "TableA4.tex",   /*
*/ se title(Climate Policy Outputs)  nonumbers /*
*/ mtitles("Model A10") label nodep nogaps star(* 0.10 ** 0.05 *** 0.01) b(%8.3f) /*
*/ nonotes addnotes("$* p < 0.10, ** p < 0.05, *** p < 0.01$" "Standard errors clustered on country in parentheses") replace  

preserve
gen rc_government=1 if execrlc==1
replace rc_government=1 if gov1rlc==1
replace rc_government=1 if execrlc==2
replace rc_government=1 if gov1rlc==2
replace rc_government=0 if rc_government==. & execrlc!=.
eststo clear
eststo: rbiprobit recur=substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion rc_government c.peaceyrs##c.peaceyrs##c.peaceyrs, endog(environment_ref=severe_dis agreement_length UN_involvement dem_index trade_openess c.envyrs##c.envyrs##c.envyrs) vce(cluster ccode)
estimates store regA11
esttab regA11, replace stats(N, fmt(%9.0fc) labels("Observations")) se star(* 0.10 ** 0.05 *** 0.01) b(%10.3f) label nonumbers mtitles("Model A11")  
esttab using "TableA5.tex",   /*
*/ se title(Political Ideology)  nonumbers /*
*/ mtitles("Model A11") label nodep nogaps star(* 0.10 ** 0.05 *** 0.01) b(%8.3f) /*
*/ nonotes addnotes("$* p < 0.10, ** p < 0.05, *** p < 0.01$" "Standard errors clustered on country in parentheses") replace  
restore

eststo clear
ipolate icrg_qog year, by(ccode) epolate gen(state_capacity)
eststo: xtreg recur i.environment_ref##i.state_capacity_dummy substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion c.peaceyrs##c.peaceyrs##c.peaceyrs i.year, fe cluster (ccode)
estimates store regA12
eststo: xtreg recur i.environment_ref##c.genaid_log substantive_agreement intra_agreement UN_involvement dem_index gdp_ln pop_ln pol_exclusion c.peaceyrs##c.peaceyrs##c.peaceyrs i.year, fe cluster (ccode)
estimates store regA13
esttab regA12 regA13, replace stats(N, fmt(%9.0fc) labels("Observations")) drop(*.year) se star(* 0.10 ** 0.05 *** 0.01) b(%10.3f) label nonumbers mtitles("Model A12" "Model A13")  
esttab using "TableA6.tex",   /*
*/ se title(Foreign Aid and State Capacity)  nonumbers /*
*/ mtitles("Model A12" "Model A13") label nodep nogaps star(* 0.10 ** 0.05 *** 0.01) b(%8.3f) /*
*/ nonotes addnotes("$* p < 0.10, ** p < 0.05, *** p < 0.01$" "Standard errors clustered on country in parentheses") replace  